#include "widget.h"
#include "ui_widget.h"
#include <QPixmap>
#include <QPainter>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    QPixmap pix(500, 500);
    QPainter painter(&pix);
    painter.setPen(Qt::red);
    painter.drawEllipse(QPoint(100, 100), 100, 100);

    // 保存
    pix.save(".\\tmp.png");
}

Widget::~Widget()
{
    delete ui;
}

